<div class="container">
    <?php
        include 'header2.php';
    ?>
    <div class="content">
    	<div class="headcontent">
            <span class="randomtext" style="margin-left:50px">Hi, 
            <?php
                global $session;
                $user_id = $session->get('userid');
                $sql="SELECT fullname FROM user WHERE iduser='$user_id'";
		$result=mysql_query($sql);
		while($res = mysql_fetch_array($result)) {
                    $nama = $res['fullname'];
		}
		echo $nama;
            ?>
            </span>
            <span class="randomtext" style="padding-left:900px">PHOTOS</span>
        	<hr/>
        </div>
    	<div class="leftcontent" style="width:435px">
            <div class="randomtext">Upload New Photo</div>
            <div>
                <form action="<?php echo BASE_PATH . "photo/upload";?>" method="post" enctype="multipart/form-data">
                    <div class="items">
                        <label style="text-align:left">File :</label><br/>
                        <input type="file" name="fphoto" /><br/>
                        <div class="validationtext" id="u_fname"></div>
                    </div>
                    <div class="items">
                        <label style="text-align:left">Category :</label><br/>
                        <select name="kateg">
                        <?php
                            $query = "SELECT * FROM kategori";
                            $result = mysql_query($query);
                            $val = 0;
                            while ($res = mysql_fetch_array($result)) {
                                echo '<option value="'.++$val.'">'.$res['namakategori'].'</option>';
                            }
                        ?>
                        </select>
                    </div>
                    <div class="items">
                        <label style="text-align:left">Access :</label><br/>
                        <select name="access">
                        	<option value="0">Public</option>
                            <option value="1">Active User</option>
                            <option value="2">Follower</option>
                            <option value="3">Private</option>
                        </select>
                    </div>
                    <div class="items">
                        <label style="text-align:left">Comment :</label><br/>
                        <select name="comment">
                            <option value="Y">Enable</option>
                            <option value="N">Disable</option>
                        </select>
                    </div>
                    <div class="items">
                        <label style="text-align:left">Description :</label><br/>
                        <textarea name="desc" rows="2" cols="25"></textarea><br/>
                        <div class="validationtext" id="u_desc"></div>
                    </div>
                    <div class="items">
                        <label style="text-align:left">Keywords :</label><br/>
                        <input type="text" name="key" style="width:220px" /><br/>
                        <div class="validationtext" id="u_key"></div>
                    </div>
                    <div class="items">
                        <label style="text-align:left">Date Taken :</label><br/>
                        <input type="text" name="tgl_ambil" style="width:220px" />
                        <div class="validationtext" id="u_tglambil"></div>
                    </div>
                    <div class="items">
                        <label style="text-align:left">Tags :</label><br/>
                        <input type="text" name="tag" style="width:220px" />
                        <div class="validationtext" id="u_tag"></div>
                    </div>
                    <div class="items">
                        <button type="submit" name="upload">Upload</button>
                    </div>
                </form>
            </div>
        </div>
        <!--<div class="clearboth"></div>-->
        <div class="rightcontent" style="width:865px">
        	
            	 <?php 
						global $session;
						
						//$photo_id = $indexFoto;
						$sql_tag = "SELECT pic,idfoto,deskripsi FROM foto WHERE iduser='$user_id'";
						$result_tag = mysql_query($sql_tag);
						while($res_tag = mysql_fetch_array($result_tag)){
							$nama_tag = $res_tag['pic'];
							$id_foto = $res_tag['idfoto'];
							$des = $res_tag['deskripsi'];
				?>
                <div class="infoitem">
                <a href="<?php echo BASE_PATH;?>pdetail/index/<?php echo $id_foto?>">
                <img src="
                <?php
            				//echo $nama_tag;
							echo $nama_tag;
				?>
                "  height="100" width="100" alt="<?php echo $des?>" style="margin-top:10px; border-style:solid" />
                <span class="randomtext" style="padding-left:200px"><?php echo $des ?></span>
                </a>
                 </div>
               
                <?php
						}
				?>
           
            <!--<div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
                <div style="position: absolute; right: 0px; top: 0px;">
                    <a href="">X</a>
                </div>
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>
            <div class="fotoitem">
            	<img src="images/pudy.jpg" alt="pudy cantik" height="100" width="100" />
            </div>-->
        </div>
        <div class="clearboth"></div>
    </div>
    <div class="footer"></div>
</div>
<?php
    global $session;

    $fullname = $session->get('fullname');
    $status = $session->get('status');
    if ($status == 1) {
        echo '<div id="fb-root"></div>
              <script src="http://connect.facebook.net/en_US/all.js"></script>
              <script>
                 FB.init({appId:"190729414302878", cookie:true,status:true, xfbml:true});
                 FB.ui({
                    method: "feed",
                    link: "http://www.facebook.com/apps/application.php?id=190729414302878",
                    picture: "https://lh6.googleusercontent.com/_hfC4HVLaFmA/TZBMdiLjQnI/AAAAAAAAABA/bSd_fg9mJgc/logo.png",
                    message: "'.$fullname.' has uploaded a new photo to YOU application"
                 });
              </script>';
    }
?>